package com.david.system.controller;

import com.david.system.pojo.Entity.MenuEntity;
import com.david.system.service.CommonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static com.david.common.utils.ResultUtils.success;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/common")
@Slf4j
public class CommonController {

    @Autowired
    private CommonService commonService;

    @PostMapping("/menudetail")
    public ResponseEntity<Object> getMenuDetails(@RequestBody ArrayList<String> pathList) {
        log.info("获取Menu信息：{}",pathList);
        List<MenuEntity> menuEntityList = commonService.getMenuDetails(pathList);
        return success(true,menuEntityList);
    }



}
